package demo2;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-11-22
 * Time: 16:56
 */
class Area{
    final double π = 3.14;
    public int a = 0;
    public int b = 0;
    public int r = 0;
    public Area(){
        this.a = a;
        this.b = b;
        this.r = r;

    }
    public void print1 (){
        System.out.println("矩形面积为："+a*b);
    }
    public void print2(){
        System.out.println("圆面积为："+π* r*r);
    }
}
public class Test1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Area area = new Area();
        System.out.print("请输入你要计算的矩形的长：");
        area.a = scanner.nextInt();
        System.out.print("请输入你要计算的矩形的宽：");
        area.b = scanner.nextInt();
        area.print1();
        System.out.print("请输入你要计算的圆的半径：");
        area.r = scanner.nextInt();
        area.print2();
    }
}
